<?php
    if(Phpfox::isModule('followedpost'))
    {
        $type_id =0;
        if(isset($this->_aVars['aFeed']['type_id']))
        {
            $type_id = $this->_aVars['aFeed']['type_id'];
        }
        else
        {
            $type_id = $this->_aVars['aFeed']['comment_type_id'];
        }
        $item_id = $this->_aVars['aFeed']['item_id'];
        $feed_id = Phpfox::getService('followedpost')->isPost($item_id,$type_id);
        //    echo 'FOLLOW FEED :'.$feed_id;
        $bFollowed = Phpfox::getService('followedpost')->isFollowed($feed_id);
        $iFollow = Phpfox::getService('followedpost')->countFollow($feed_id);
        if($bFollowed):
            $iFollow = (int) $iFollow -1;
            endif
    ?>
    <?php if ($iFollow > 0) :?>
        <li>
            <p style="color: #63799F">Followed by <label><?php echo $iFollow;?></label> wayters</p>
        </li>
        <li><span>|</span></li>
        <?php else: ?>
        <li style="display: none;">
            <p style="color: #63799F">Followed by <label></label> wayters</p>
        </li>
        <?php endif; ?>
    <?php if (!$bFollowed) : ?>
        <li id='followedpost_makeFollowed_<?php echo $feed_id; ?>' style=" display: block;">
            <a href="javascript:void(0)" onclick="$.ajaxCall('followedpost.makeFollowed', 'id=<?php echo $feed_id; ?>', 'GET')">
                <?php echo Phpfox::getPhrase('followedpost.followed'); ?>
            </a>
        </li>
        <li id='followedpost_makePublic_<?php echo $feed_id; ?>' style=" display: none;">
            <a href="javascript:void(0)" onclick="$.ajaxCall('followedpost.makePublic', 'id=<?php echo $feed_id; ?>', 'GET')">
                <?php echo Phpfox::getPhrase('followedpost.public'); ?>
            </a>
        </li>
        <!--<li><span>|</span></li>-->
        <?php else: ?>
        <li id='followedpost_makePublic_<?php echo $feed_id; ?>' style="display: block;">
            <a href="javascript:void(0)" onclick="$.ajaxCall('followedpost.makePublic', 'id=<?php echo $feed_id; ?>', 'GET')">
                <?php echo Phpfox::getPhrase('followedpost.public'); ?>
            </a>
        </li>
        <li id='followedpost_makeFollowed_<?php echo $feed_id; ?>' style="display: none;">
            <a href="javascript:void(0)" onclick="$.ajaxCall('followedpost.makeFollowed', 'id=<?php echo $feed_id; ?>', 'GET')">
                <?php echo Phpfox::getPhrase('followedpost.followed'); ?>
            </a>
        </li>
        <!--<li><span>|</span></li>-->
        <?php endif; ?>
    <?php }?>
    
